package idiet.service;

import java.util.List;

import idiet.bean.NurseTarget;
import idiet.dao.hibernate.NurseTargetDao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("nurseTargetService")
public class NurseTargetService {
	@Autowired
	NurseTargetDao nurseTargetDao;
	public NurseTarget getNurseTargetById(int nurseTargetId){
		return this.nurseTargetDao.getNurseTargetById(nurseTargetId);
	}
	public List<NurseTarget> getNurseTargetsByNurseTargetName(String nurseTargetName){
		if(nurseTargetName==null){
			return this.nurseTargetDao.getNurseTargets();
		}else{
			return this.nurseTargetDao.getNurseTargetsByNurseTargetName(nurseTargetName);
		}
	}
	public void createNurseTarget(NurseTarget nurseTarget){
		this.nurseTargetDao.createNurseTarget(nurseTarget);
	}
	public void updateNurseTarget(NurseTarget nurseTarget){
		this.nurseTargetDao.updateNurseTarget(nurseTarget);
	}
	public void deleteNurseTarget(NurseTarget nurseTarget){
		this.nurseTargetDao.deleteNurseTarget(nurseTarget);
	}
}
